<?php

class WebUser extends CWebUser {
 
  // This is a function that checks the field 'role'
  // in the User model to be equal to 1, that means it's admin
  // access it by Yii::app()->user->isAdmin()
  public function isAdmin(){
  	if (Yii::app()->user->name == 'admin')
  		return 0;
  	else
  		return 1;
    //$user = $this->loadUser(Yii::app()->user->id);
    //return intval($user->role) == 1;
  }
  
  // http://www.yiiframework.com/wiki/60/
 
}